﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ComponentModel.DataAnnotations;

namespace LightWeb.MvcWeb.Areas.SmartPfa.Models
{
    public class StockCashFlowModel : AbstractViewModel
    {
        [Display(Name = "DealDate")]
        public DateTime DealDate { get; set; }

        [Display(Name = "StockCode")]
        public string StockCode { get; set; }

        [Display(Name = "StockName")]
        public string StockName { get; set; }

        [Display(Name = "DealPrice")]
        public double DealPrice { get; set; }

        [Display(Name = "DealQty")]
        public int DealQty { get; set; }

        [Display(Name = "BizType")]
        public string BizType { get; set; }

        [Display(Name = "TotalCash")]
        public double TotalCash { get; set; }

        [Display(Name = "RaminCash")]
        public double RaminCash { get; set; }

        [Display(Name = "InvestorCode")]
        public string InvestorCode { get; set; }

        public static StockCashFlowModel FromDomainModel(DomainModel.StockCashFlow domainModel)
        {
            return new StockCashFlowModel
            {
                Id = domainModel.PrimaryKey,
                DealDate = domainModel.DealDate,
                StockCode = domainModel.StockCode,
                StockName = domainModel.StockName,
                DealPrice = domainModel.DealPrice,
                DealQty = domainModel.DealQty,
                BizType = domainModel.BizType,
                TotalCash = domainModel.TotalCash,
                RaminCash = domainModel.RaminCash,
                InvestorCode = domainModel.InvestorCode

            };
        }
    }

    public abstract class AbstractViewModel
    {
         [Display(Name = "Id")]
        public int Id { get; set; }
    }
}